<?php
/**
* @package Scribble
* @subpackage Plugin
*/
$urlRoot = Buan\Config::get('ext.Scribble.plugin.SpTemplateEditor.urlRoot');
Buan\View::getGlobalView()->addStylesheets("{$urlRoot}/css/edit.css");
Buan\View::getGlobalView()->addJavascripts("{$urlRoot}/js/common.js", "{$urlRoot}/js/edit.js");
?>
<div class="head">
	<h1>Template Editor</h1>
	<h2>Edit, "<?php $this->html->e($template->getTitle()); ?>"</h2>
</div>

<form method="post">
	<div class="std-tabbed">
		<div class="std">
			<h3><u>G</u>eneral Information</h3>

			<dl>
				<dt>Which rendering language would you prefer to use for generating the markup?</dt>
				<dd>
					<select name="renderEngine">
					<?php foreach($renderEngines as $re): ?>
						<option value="<?php echo $re['name']; ?>"<?php echo $template->renderEngine==$re['name'] ? ' selected="selected"' : ''; ?>><?php $this->html->e($re['label']); ?></option>
					<?php endforeach; ?>
					</select>
				</dd>
			</dl>
	
			<dl class="required">
				<dt>Title</dt>
				<dt class="aid">Your template will be known by this title</dt>
				<dd>
					<input class="medium" type="text" name="title" value="<?php $this->html->e($template->getTitle()); ?>" />
				</dd>
			</dl>
	
			<dl>
				<dt>Short description</dt>
				<dd>
					<input class="large" type="text" name="shortdesc" value="<?php $this->html->e($template->getShortDescription()); ?>" />
				</dd>
			</dl>
	
			<dl>
				<dt>Long description</dt>
				<dt class="aid">Describe how to use your template</dt>
				<dd>
					<textarea rel="scribble-widget" scribblewidget:type="rte" scribblewidget:config="rteTemplateLongDesc" name="longdesc"><?php $this->html->e($template->getLongDescription()); ?></textarea>
				</dd>
			</dl>
		</div>

		<div class="std">
			<h3><u>P</u>opulator markup</h3>
			<textarea class="fullwidth markup" name="markup[populator]" wrap="off"><?php $this->html->e($populatorMarkup); ?></textarea>
		</div>
	
		<div class="std">
			<h3><u>F</u>rontend markup</h3>
			<textarea class="fullwidth markup" name="markup[frontend]" wrap="off"><?php $this->html->e($frontendMarkup); ?></textarea>
		</div>
	</div>

	<p>
		<button class="submit" type="submit" name="btnsave">Save Changes</button>
	</p>
</form>